package com.yuanchu.order.client;

import com.yuanchu.common.utils.R;
import com.yuanchu.order.entity.YoshopUserCouponEntity;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @version: 1.0
 * @Author: adan
 * @description:
 * @date: 2024-01-24 11:55
 */
@FeignClient(value = "yuanchu-marketing", fallbackFactory = FeignCouponServiceClientFallbackFactory.class)
public interface FeignCouponClient {
    /**
     * 根据优惠券id查询优惠券详情
     * @param couponId
     * @return
     */
    @GetMapping("marketing/coupon/user")
    List<YoshopUserCouponEntity> queryUserCoupon(@RequestParam("couponId") Integer couponId, @RequestParam("userId") Integer userId);

    /**
     * 更新优惠券状态
     * @param userId
     * @param storeId
     * @return
     */
    @PostMapping("marketing/coupon/user/status")
    R updateUserCouponStatus(@RequestParam("userId") Integer userId
            ,@RequestParam("couponId") Integer couponId, @RequestParam("storeId") Integer storeId);




}
